package com.laboratory.report.lab02.lab0203;

/**
 * 猫
 */
public class Cat extends Animal implements Pet {

    private String name;

    public Cat(String name) {
        super("cat", 4);
        this.name = name;
    }

    public Cat(String type, int legs) {
        this("");
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public void play() {
        System.out.println("Cat is playing");
    }

    @Override
    public void eat() {
        System.out.println(name + " eating");
    }
}
